<template>
    <el-carousel :trigger="trigger" :height="height" :autoplay="autoplay" :initial-index="initialIndex"
                 :interval="interval" :loop="loop" :indicator-position="indicatorPosition" :arrow="arrow" :type="type"
                 :direction="direction">
        <el-carousel-item v-for="item in data" :key="item" v-if="data">
            <div class="title">{{item}}</div>
        </el-carousel-item>
        <slot v-if="!data"></slot>
    </el-carousel>
</template>

<script>
    export default {
        name: 'carousel',
        props: ['height', 'trigger', 'autoplay', 'interval', 'initialIndex', 'indicatorPosition', 'arrow', 'type', 'loop', 'direction', 'data'],
        data() {
            return {}
        },
        mounted() {
        },
        methods: {},
        components: {}

    }
</script>

<style scoped lang="less">
    .el-carousel__item .title {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 200px;
        margin: 0;
    }

    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }
</style>
